package org.example.leetcpde;

public class number {

    public boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }

        int num = 0, in = x;

        do {
            num = num * 10 + x % 10;
        } while ((x /= 10) != 0);


        return in == num;
    }
}
